package com.java2104.mapper;

import com.java2104.entity.Job;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

public interface JobMapper {
    //查询
    List<Job> selectJobName(String name);
    //根据id查找
    @Select("select * from job_inf where id=#{param1}")
    Job findByPrimaryKey(Integer id);
    //修改用户信息
    @Update("update job_inf set name=#{name},remark=#{remark} where id=#{id}")
    int update(Job job);
    @Insert("insert into job_inf value(null,#{name},#{remark})")
    int insertJob(Job job);

    @Select("select count(*) from job_inf where name=#{name} ")
    int selectName(String name);

    @Delete("DELETE from job_inf where id=#{param1}")
    int delete(Integer id);

    @Select("select id from job_inf")
    List<Integer> findIds();

    @Select("select count(*) from employee_inf where job_id=#{param1}")
    Integer findCountOfJobId(Integer id);
}
